package net.towee.model.account;

import java.util.List;

import net.towee.model.group.GroupIdentity;

import com.google.gwt.user.client.rpc.IsSerializable;

/**
 * This object contains information of board, such as name, attached groups, attached widgets and their settings.
 * @author  c58
 */
public interface Board extends IsSerializable {
	/**
	 * @return id of this board
	 */
	String getId();
	
	/**
	 * @return  board name
	 */
	String getName();
	
	/**
	 * Set new board name
	 * @param  name
	 */
	void setName(String name);
	
	/**
	 * @return list of attached to board widgets
	 */
	List<Gadget> getGadgets();
	
	/**
	 * Add new widget to board
	 * @param w
	 */
	void addGadget(Gadget w);
	
	/**
	 * Delete widget from board
	 * @param w
	 */
	void deleteGadget(Gadget w);
	
	/**
	 * @return list of attached to board groups
	 */
	List<GroupIdentity> getAttachedGroups();
	
	/**
	 * Attach new group to board
	 * @param id
	 */
	void attachGroup(GroupIdentity group);
	
	/**
	 * Detach group from board
	 * @param id
	 * @return TODO
	 */
	boolean detachGroup(GroupIdentity group);

	/**
	 * Detach group by given group id
	 * @param groupId
	 */
	boolean detachGroup(String groupId);

	/**
	 * Set an id for board
	 * @param string
	 */
	void setId(String string);

	/**
	 * Return true if gadget with given name contains in board
	 * @param canonicalName
	 * @return
	 */
	boolean containsGadget(String canonicalName);

	/**
	 * Delete gadget from board by gadget id
	 * @param gadgetId
	 */
	void deleteGadget(String gadgetId);

	/**
	 * Return true if board contain given group
	 * @param id
	 * @return
	 */
	boolean hasAttachedGroup(String id);
}
